package question14;

import java.util.*;

/**
 * leetcode上可以通过，但是平台通不过
 */
public class MinStack {

    PriorityQueue<Integer> priorityQueue;
    Stack<Integer> stack;

    public MinStack() {
        this.priorityQueue = new PriorityQueue<>(Integer::compareTo);
        this.stack = new Stack<>();
    }

    void push(int val) {
        stack.push(val);
        priorityQueue.add(val);
    }

    void pop() {
        Integer pop = stack.pop();
        priorityQueue.remove(pop);
    }

    int top() {
        return stack.peek();
    }

    int getMin() {
        return priorityQueue.peek();
    }

    public static void main(String[] args) {
//        StringBuilder sb = new StringBuilder();
//
//        MinStack minStack = new MinStack();
//        Scanner scanner = new Scanner(System.in);
//        String[] operator = scanner.nextLine().split(",");
//        Integer[] data = Arrays.stream(scanner.nextLine().split(",")).map(Integer::valueOf).toArray(Integer[]::new);
//        for (int i = 0; i < operator.length; i++) {
//            if ("push".equals(operator[i])) {
//                minStack.push(data[i]);
//                sb.append("null" + ",");
//            } else if ("pop".equals(operator[i])) {
//                minStack.pop();
//                sb.append("null" + ",");
//            } else if ("top".equals(operator[i])) {
//                int top = minStack.top();
//                sb.append(top + ",");
//            } else if ("getMin".equals(operator[i])) {
//                sb.append(minStack.getMin() + ",");
//            }
//        }
//        System.out.println(sb.substring(0, sb.length() - 1));

        Map<String, Object> summaryCompareRate = new HashMap<>();
        HashMap<String, Object> objectObjectHashMap = new HashMap<>();
        summaryCompareRate.putAll(objectObjectHashMap);
        System.out.println("12");
        System.out.println("er");
    }
}
